package cn.ds.assets.module.assets.controller.admin.metadataJobInstance.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;

import static cn.ds.assets.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

/**
 * 元数据管理-元数据采集作业实例 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 */
@Data
public class BaseMetadataJobInstanceBaseVO {

    @Schema(description = "作业主键id,关联assets_metadata_collect_job的id字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "18891")
    @NotNull(message = "作业主键id,关联assets_metadata_collect_job的id字段不能为空")
    private Long jobId;

    @Schema(description = "状态,1:执行中,2:成功,3:失败,4:超时,5:已取消", example = "2")
    private Byte status;

    @Schema(description = "业务日期")
    private LocalDate businessDate;

    @Schema(description = "开始时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime startTime;

    @Schema(description = "结束时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime endTime;

    @Schema(description = "运行时长,单位:秒")
    private Long runtime;

    @Schema(description = "日志")
    private String msg;

    @Schema(description = "项目空间ID,关联assets_project的id字段", example = "894")
    private Long projectId;

    @Schema(description = "下次执行时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime nextTime;

    @Schema(description = "作业编码,关联assets_metadata_collect_job的job_code字段")
    private String jobCode;

}
